jQuery(document).ready(function($) {

	require(
		["text!header.html", "text!sidebar.html", "text!navigator.html", "text!content.html", "text!footer.html"],
		function(header, sidebar, navigator, content, footer) {
			vueComponetStart(header, sidebar, navigator, content, footer);
			vueStart();
			//延迟
			/*setTimeout(function() {
				console.log("page loading ...");
			}, 20);
			*/
			$(".sideMenu").slide({
				titCell: "h3", //鼠标触发对象
				targetCell: "ul", //与titCell一一对应，第n个titCell控制第n个targetCell的显示隐藏
				effect: "slideDown", //targetCell下拉效果
				delayTime: 300, //效果时间
				triggerTime: 150, //鼠标延迟触发时间（默认150）
				defaultPlay: true, //默认是否执行效果（默认true）
				returnDefault: true //鼠标从.sideMen移走后返回默认状态（默认false）
			});
			$(".slideTxtBox").slide();
		})

	function vueStart() {
		var meshApp = new Vue({
			el: "#meshApp",
			data: {
				loginfo: []
			},
			methods: {},
			watch: {},
			computed: {},
			ready: function() {
				//在编译结束和 $el 第一次插入文档之后调用，如在第一次 attached 钩子之后调用。注意必须是由 Vue 插入（如 vm.$appendTo() 等方法或指令更新）才触发 ready 钩子。
				console.log("一切准备好了");
			},
			created: function() {
				console.log("vue主程序已创建");
			},
			destroyed: function() {
				console.log("vue主程序已销毁");
			}
		})
	}

	function vueComponetStart(header, sidebar, navigator, content, footer) {
		Vue.component("meshheader", {
			props: ['headerInfo'],
			template: header,
			data: function() {
				return {}
			},
			created: function() {
				console.log("vue componet header created!");
			},
			destroyed: function() {
				console.log("vue componet header destroyed!");
			}

		});
		Vue.component("sidebar", {
			props: ['sidebarInfo'],
			template: sidebar,
			data: function() {
				return {}
			},
			created: function() {
				console.log("vue componet sidebar created!");
			},
			destroyed: function() {
				console.log("vue componet sidebar destroyed!");
			}

		});
		Vue.component("navigator", {
			props: ['navigatorInfo'],
			template: navigator,
			data: function() {
				return {}
			},
			created: function() {
				console.log("vue componet navigator created!");
			},
			destroyed: function() {
				console.log("vue componet navigator destroyed!");
			}

		});
		Vue.component("meshcontent", {
			props: ['contentInfo'],
			template: content,
			data: function() {
				return {}
			},
			created: function() {
				console.log("vue componet content created!");
			},
			destroyed: function() {
				console.log("vue componet content destroyed!");
			}

		});
		Vue.component("meshfooter", {
			props: ['footerInfo'],
			template: footer,
			data: function() {
				return {}
			},
			created: function() {
				console.log("vue componet footer created!");
			},
			destroyed: function() {
				console.log("vue componet footer destroyed!");
			}

		});
	}

})